package demo.common.web;

import demo.base.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by llq on 2017/8/17.
 */
public class HttpUtils {

    public static Integer getCurrentUserId(HttpServletRequest request){
        String userId = request.getHeader("current-user-id");
        if(StringUtils.isNullOrEmpty(userId)){
            return null;
        }else {
            return Integer.parseInt(userId);
        }
    }

}
